package mka.puzzle.image;

import java.awt.Graphics;
import java.awt.Shape;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class LoadImage{
    
    BufferedImage img;

//    public void paint(Graphics g) {
//        g.drawImage(img, 0, 0, null);
//    }
//
//    public void LoadImageApp() {
//       try {
//           img = ImageIO.read(new File("image/java_logo.jpg"));
//       } catch (IOException e) {
//       }
//
//    }

    public static void main(String[] args) throws IOException {
    	String path = "image/java_logo.jpg";
        File file = new File(path);
        BufferedImage image = ImageIO.read(file);

        JLabel label = new JLabel(new ImageIcon(image));
        
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(label);
        f.pack();
        f.setLocation(300,200);
        f.setVisible(true);
    }
}
